﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="popupSearchWork.aspx.cs"
    Inherits="MTRC.ODMS.Web.SOM.Popup.popupSearchWork" %>

<%@ Register Assembly="APJ.Web.UI.WebControls" Namespace="APJ.Web.UI.WebControls"
    TagPrefix="APJ" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Disposal Case Detail</title>
    <base target="_self" />
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <link href="<%=ResolveUrl("~/CSS/common.css")%>" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Javascript/CommonFunction.js"></script>
    <script type="text/jscript">
        var pageID;
        function setWorkInfor(TNNo, TransNo, JobNature, JobLocation, JobProtection, IsCopyAllButon) {
            window.dialogArguments.form1.txtTNNumber.value = TNNo;
            window.dialogArguments.form1.txtTransactionNumber.value = TransNo
            //            alert(IsCopyAllButon);
            //            alert(IsCopyAllButon == true || IsCopyAllButon=='true');
            if (IsCopyAllButon == true || IsCopyAllButon == 'true' || IsCopyAllButon == 'True') {
                window.dialogArguments.form1.txtJobLocation.value = JobLocation;
            } else {
                window.dialogArguments.form1.txtJobLocation.value = "";
            }
            window.dialogArguments.form1.txtJobNature.value = JobNature;
            window.dialogArguments.form1.txtJobProtection.value = JobProtection;
            window.close();
        }
        //add by Nathan  2015.08.17 begin
        var selectRow = null;
        var RowColor = "#FFFFFF";
        function SetTNNo(TNNo, TransNo, JobNature, JobLocation, JobProtection, IsCopyAllButon, row) {

            document.getElementById("txtTNNumber").value = TNNo;
            document.getElementById("txtTransactionNumber").value = TransNo;
            document.getElementById("txtJobLocation").value = JobLocation;
            document.getElementById("txtJobNature").value = JobNature;
            document.getElementById("txtJobProtection").value = JobProtection;
            var Color = row.style.backgroundColor;
            row.style.backgroundColor = "#CCFFCC";
            if (selectRow == row) {
                return;
            }
            if (selectRow != null) {
                selectRow.style.backgroundColor = RowColor;
            }
            selectRow = row;
            RowColor = Color;
        }


        function GetPossession() {
            window.dialogArguments.form1.txtTNNumber.value = document.getElementById("txtTNNumber").value;
            window.dialogArguments.form1.txtTransactionNumber.value = document.getElementById("txtTransactionNumber").value
            window.dialogArguments.form1.txtJobLocation.value = document.getElementById("txtJobLocation").value;
            window.dialogArguments.form1.txtJobNature.value = document.getElementById("txtJobNature").value;
            window.dialogArguments.form1.txtJobProtection.value = document.getElementById("txtJobProtection").value;
            window.close();
        }
        function Only() {
            window.dialogArguments.form1.txtTNNumber.value = document.getElementById("txtTNNumber").value;
            window.dialogArguments.form1.txtTransactionNumber.value = document.getElementById("txtTransactionNumber").value
            window.dialogArguments.form1.txtJobLocation.value = "";
            window.dialogArguments.form1.txtJobNature.value = document.getElementById("txtJobNature").value;
            window.dialogArguments.form1.txtJobProtection.value = document.getElementById("txtJobProtection").value;
            window.close();
        }
        function WClose() {
            window.close();
        }
        //End add by Nathan  2015.08.17 begin
    </script>
</head>
<body style="width: auto;" onload="setHeight()">
    <form id="form1" runat="server">
    <table cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td style="width: 1%">
            </td>
            <td>
                <div id="DIVGridView" style="width: 100%; height: 400px; overflow: auto;">
                    <br />
                    <table cellpadding="0" cellspacing="0" width="97%">
                        <tr>
                            <td >
                                <APJ:CommonGridView ID="grdPopSearchStaff" runat="server" AllowPaging="True" DataKeyNames="GrantTN"
                                    AutoGenerateColumns="False" OnRowDataBound="grdPopSearchStaff_OnRowDataBound"
                                    BorderColor="black" CssClass="GridView" AllowSorting="True" AscPic="~/Images/Common/arrow_up_green.png"
                                    DescPic="~/Images/Common/arrow_down_green.png" Width="100%" PageLinkCount="7">
                                    <Columns>
                                        <asp:BoundField DataField="GrantTN" HeaderText="SOM_TNNumber" SortExpression="GrantTN">
                                        <ItemStyle Width="65px" />
                                        </asp:BoundField>
                                        <%--<asp:HyperLinkField DataTextField="GrantTN" HeaderText="SOM_TNNumber" SortExpression="GrantTN">
                                                    <ItemStyle CssClass="HandCursorClass" Width="150px" />
                                             </asp:HyperLinkField>--%>
                                        <asp:TemplateField HeaderText="SOM_TransactionNumber" SortExpression="GrantMasTrxnNo">
                                            <ItemTemplate>
                                                <%# Eval("GrantMasTrxnNo").ToString().Substring(0, 7) %><br />
                                                <%# Eval("GrantMasTrxnNo").ToString().Substring(7) %>
                                            </ItemTemplate>
                                            <ItemStyle Width="65px" />
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="JobNature" HeaderText="SOM_JobNature" SortExpression="JobNature">
                                            <ItemStyle Width="30%" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="JobLocation" HeaderText="SOM_JobLocation" SortExpression="JobLocation">
                                        </asp:BoundField>
                                        <asp:BoundField DataField="JobProtection" HeaderText="SOM_JobProtection" SortExpression="JobProtection">
                                        </asp:BoundField>
                                    </Columns>
                                    <RowStyle CssClass="GridView_Row"></RowStyle>
                                    <HeaderStyle CssClass="GridView_Header"></HeaderStyle>
                                    <AlternatingRowStyle CssClass="GridView_AlternativeRow"></AlternatingRowStyle>
                                    <EmptyDataRowStyle CssClass="GridView_Header" />
                                    <PagerTemplate>
                                        <asp:Table ID="CommonPagerTemplate" runat="server" Width="100%">
                                            <asp:TableRow ID="COMGRIDV_TR" runat="server">
                                                <asp:TableCell ID="COMGRIDV_Pager_Cell_TotalRecords" runat="server" CssClass="GridView_Pager_Cell_TotalRecords">
                                                    <asp:Label ID="Lbl_T_TotalRecords" runat="server">Total Records:</asp:Label>
                                                    <asp:Label ID="Lbl_V_TotalRecords" runat="server"></asp:Label>
                                                    &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;<asp:Label
                                                        ID="Lbl_V_CurPage" runat="server"></asp:Label>
                                                    &nbsp;<asp:Label runat="server">/</asp:Label>
                                                    &nbsp;<asp:Label ID="Lbl_V_TotalPages" runat="server"></asp:Label>
                                                </asp:TableCell>
                                                <asp:TableCell runat="server" CssClass="GridView_Pager_Cell_SelectedRecords" ID="COMGRIDV_Pager_Cell_SelectedRecords"></asp:TableCell>
                                                <asp:TableCell ID="COMGRIDV_Pager_Cell_PageSize" runat="server" CssClass="GridView_Pager_Cell_PageSize">
                                                    <asp:Label ID="Lbl_T_PageSize" runat="server">PageSize:</asp:Label>
                                                    &nbsp;&nbsp;<asp:DropDownList ID="DDL_PageSize" runat="server" AutoPostBack="True">
                                                        <asp:ListItem Value="5">5</asp:ListItem>
                                                        <asp:ListItem Value="10">10</asp:ListItem>
                                                        <asp:ListItem Value="15">15</asp:ListItem>
                                                        <asp:ListItem Value="20">20</asp:ListItem>
                                                        <asp:ListItem Value="25">25</asp:ListItem>
                                                        <asp:ListItem Value="30">30</asp:ListItem>
                                                    </asp:DropDownList>
                                                </asp:TableCell>
                                                <asp:TableCell ID="COMGRIDV_Pager_Cell_Prev" runat="server" CssClass="GridView_Pager_Cell_Prev">
                                                    <asp:LinkButton ID="LBtn_Previous" runat="server" CommandArgument="Prev" CommandName="Page"><</asp:LinkButton>
                                                </asp:TableCell>
                                                <asp:TableCell ID="COMGRIDV_Pager_Cell_PagerLink" runat="server" CssClass="GridView_Pager_Cell_PagerLink">
                                                    <asp:Panel ID="Pnl_PageLink" runat="server" CssClass="GridView_Pager_PageLinkPanel">
                                                    </asp:Panel>
                                                </asp:TableCell>
                                                <asp:TableCell ID="COMGRIDV_Pager_Cell_Next" runat="server" CssClass="GridView_Pager_Cell_Next">
                                                    <asp:LinkButton ID="LBtn_Next" runat="server" CommandArgument="Next" CommandName="Page">></asp:LinkButton>
                                                </asp:TableCell>
                                            </asp:TableRow>
                                        </asp:Table>
                                    </PagerTemplate>
                                    <EmptyDataTemplate>
                                        <asp:Table runat="server" CssClass="GridView_Header_EmptyData">
                                            <asp:TableRow runat="server">
                                                <asp:TableCell runat="server" Style="border-right: black 1px solid;"></asp:TableCell>
                                                <asp:TableCell runat="server" Style="border-right: black 1px solid;"></asp:TableCell>
                                                <asp:TableCell runat="server" Style="border-right: black 1px solid;"></asp:TableCell>
                                                <asp:TableCell runat="server" Style="border-right: black 1px solid;"></asp:TableCell>
                                                <asp:TableCell runat="server"></asp:TableCell>
                                            </asp:TableRow>
                                        </asp:Table>
                                    </EmptyDataTemplate>
                                </APJ:CommonGridView>
                            </td>
                        </tr>
                        <tr>
                            <td style="float: right; width: 25%" align="right">
                                
                            </td>
                        </tr>
                    </table>
                </div>
            </td>
            <td style="width: 1%">
            </td>
        </tr>
         <tr>
            <td style="width: 1%">
            </td>
            <td>
                    <table cellpadding="0" cellspacing="0" width="97%">
                        <tr>
                            <td align="center">
                               
                            </td>
                        </tr>
                        <tr>
                            <td style="float: right; width: 25%" align="right">
                                <%--Add Date: 2015-08-18 Nathan--%>
                                <asp:TextBox ID="txtTNNumber" runat="server" Text="" Style="display: none;"></asp:TextBox>
                                <asp:TextBox ID="txtTransactionNumber" runat="server" Text="" Style="display: none;"></asp:TextBox>
                                <asp:TextBox ID="txtJobLocation" runat="server" Text="" Style="display: none;"></asp:TextBox>&nbsp;
                                <asp:TextBox ID="txtJobNature" runat="server" Text="" Style="display: none;"></asp:TextBox>&nbsp;
                                <asp:TextBox ID="txtJobProtection" runat="server" Text="" Style="display: none;"></asp:TextBox>&nbsp;
                                <asp:Button ID="btnCopyAllPossession" runat="server" Text="" Visible="false" />&nbsp;<%--OnClick="btnCopyAllPossession_Click"--%>
                                <asp:Button ID="btnCopyProtectionOnly" runat="server" Text="" Visible="false" />&nbsp;
                                <asp:Button ID="btnCancel" runat="server" Text="" Visible="true" />
                               
                                <%--Add Date: 2015-08-18 Nathan--%>
                            </td>
                        </tr>
                    </table>
            </td>
            <td style="width: 1%">
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
<script type="text/jscript">
    <%--Add Date: 2015-08-31 benson--%>
    function setHeight(){
//        alert(document.getElementById("grdPopSearchStaff").offsetHeight);
        var grdheight = document.getElementById("grdPopSearchStaff").offsetHeight;
        if (grdheight < 350) {
            if(grdheight < 80){
                document.getElementById("DIVGridView").style.height = 80;
            }else{
                document.getElementById("DIVGridView").style.height = grdheight+50;
            }
        }
    }
        <%--Add Date: 2015-08-31 benson--%>
    </script>